home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_game / sdl212x.zip / SD_DEVLP.TXT < prev    next >
Text File  |  1996-05-15  |  30KB  |  772 lines

  1. -------------------------------------------------------------------------
  2. STARDOCK LOCO - Expansion module help for programmers - IGM's
  3. -------------------------------------------------------------------------
  4.  
  5. You are welcome to write any code that you wish for Stardock Loco's
  6. expansion module features, as long as you give me credit, and you do not
  7. charge more than the cost of Stardock Loco - if you create a module
  8. that you wish to have them register.  I would like to have a look at it
  9. for approval, to make sure it stays within the game story, and doesn't
  10. trash a BBS's game files.
  11.  
  12. I do _not_ require any $$ from the proceeds of your module(s).  But if you
  13. want, send it over... <G>
  14.  
  15. The module must run from one of the expansion module areas in the game.
  16.  
  17. If you create a module, upload it to the support bbs, and I like it, I will
  18. send you a registration key for yourself or for your favorite BBS.  It
  19. doesn't necessarily have to be a great or large module by any means,
  20. just something creative and interesting. I'm pretty easy on the standards!
  21. Heck, this is all for fun anyway!
  22.  
  23. See the very bottom of this file for the support bbs numbers and how to get
  24. in touch with me if you need help.
  25.  
  26.  
  27. There are many IGM/expansion module areas:
  28.  
  29. * The <U> Upstairs and <D> Downstairs portions of Terran Pete's Slush Bar.
  30. * The <O> Other Places area in the ShipYards. (30 slots)
  31. * The area on board a players ship: <G> Go for a cruise.
  32. * The Blackmarket.   <Enter> at the Main Menu.
  33. * Favrie Colony IGM slots.  (5 slots)
  34.  
  35. NEW:
  36. * Sickbay, Weaponshop, Armorshop, Terran Pete's, Sleeping Pods, Bank, Nehrus,
  37.   Other Aliens.
  38.  
  39. Feel free to create new places for the following:
  40.  
  41.   These are accessed:
  42.  
  43.     Sickbay:    sb??????.exe
  44.     WeaponShop:     ws??????.exe
  45.     ArmorShop:      as??????.exe
  46.     Terran Petes:   tp??????.exe
  47.     Sleeping Pods:  sp??????.exe
  48.     Bank:           bk??????.exe
  49.     Nehru's Arena:  na??????.exe
  50.     Other Aliens:   oa??????.exe
  51.  
  52. If you drop an .exe into the SDL directory with the beginning letters of the
  53. above, it will bypass my code for those areas.  Your IGM will appear instead.
  54. Give it a try by copying roid.exe to sbroid.exe and you will see what I mean.
  55.  
  56.  
  57.  
  58. IGM Necessary Information:
  59. ---------------------------------------------------------------------------
  60. SDLoco was created using Brian Pirie's Opendoors program. If you are unfamiliar
  61. with this C library, I recommend that you download it from a BBS, and register
  62. it if you are going to use his library.  You may NOT attach a module that
  63. uses a library or program that is unregistered that interfaces with a modem,
  64. a BBS, and with Stardock Loco.  I accept no responsibility for your program
  65. and/or its uses!
  66.  
  67. <Mean Mode OFF>  :)
  68.  
  69. ----------------------------------------------------------------------------
  70. NEW ADDITION:  I have just added MODULE.C to the stardock zip file.  It
  71. contains the full source of the blkmkt1.exe to get you started easier on a mod.
  72. Just trying to make it easier on all of us...:)   You may want to read the
  73. code below, to get a little more insight, and see why I did what.....
  74.  
  75. Feel free to use module.c
  76. as a starting point for your module.  You can create a new black market that
  77. runs from that slot, but you must include the armor and weapon upgrades as
  78. part of your black market.  Note:  It is written using Brian Pirie's Opendoors
  79. serial comm door program, and cannot be compiled without the odoorh.lib.  But,
  80. you can change that easily if you have another program that you use.  See the
  81. MODULE.C for more information.
  82.  
  83. That slot is accessed by blkmkt?.exe, the question mark being the number or
  84. letter that you or I add to it.  The version included with sdloco is
  85. blkmkt1.exe.
  86.  
  87. --------------------------------------------------------------------------
  88. The Shipyards Expansion Slots
  89. --------------------------------------------------------------------------
  90. If you create a module, it would be a good idea to include a description
  91. for the Sysop to type into the sd_add.exe program.  Or you can write an
  92. easy install, and add it yourself.  See the structure of the module.lst
  93. file below.  (waaaay below..)  <--this only applies to the shipyards module
  94. area!
  95.  
  96.  
  97. -------------------------------------------------------------------------
  98. Terran Pete's   module slots
  99. -------------------------------------------------------------------------
  100. For the upstairs/downstairs area, no description is necessary.  All that you
  101. must do is begin the module name with:
  102.  
  103.             dn   To run from Downstairs
  104.             up   To run from Upstairs
  105.  
  106.         Example:   DNmymod.exe  <--it must end with .exe
  107.  
  108.         -And then dump it in the sdloco directory.
  109.  
  110. I use the C function _dos_findfirst to look for the module.  I am using the
  111. wildcard characters in the following way:
  112.             up*.exe
  113.             dn*.exe
  114.  
  115. Whatever you put between the up/dn and the .exe doesn't matter to me.  Do
  116. note that it looks for the first occurence of an "up" or a "dn", and will
  117. run that module.  If there are other modules in the directory, it will
  118. run the _first_ one it finds.  Make sure to notify the sysop of this, and
  119. tell them about removing another up/dn module, and possibly renaming it
  120. and adding it to the shipyard module area using the sd_add.exe.
  121.  
  122. -------------------------------------------------------------------------
  123. On board the ship   module slot    <G> Go for a cruise
  124. -------------------------------------------------------------------------
  125. For the on-board the ship area, no description is necessary.  All that you
  126. must do is begin the module name with:
  127.  
  128.                nd
  129.  
  130.         Example:   ndMymod.exe  <--it must end with .exe
  131.  
  132.         -And then dump it in the sdloco directory.
  133.  
  134.       This one is accessed from the <G> Go for a cruise part of the menu.
  135.       Feel free to create a new ending for the game if you wish!  Or take
  136.       'em for a ride to the center of the universe...I dinna care!  <G>
  137.  
  138.       Once again, I am using _dos_find_first!  See the Terran Pete's module
  139.       slot reference about this.
  140.  
  141. -------------------------------------------------------------------------
  142. Favrie Colony * New Developments Area
  143. -------------------------------------------------------------------------
  144. This area is for those of you that wish to create a planet based IGM.  There
  145. are 5 slots.  You will have to create a text file for the description of your
  146. module.  Just open an editor such as dos edit, and type in your description
  147. on the first line.  You have a 50 character line you can use. If you like, you
  148. can colorize your description with the following:
  149.         `red`         For bright colors:
  150.         `blue`          add bright:
  151.         `yellow`        example:  `bright red`
  152.         `cyan`
  153.         `green`
  154.  
  155. Here is an example description:
  156. `bright green`Into the Jungles of Favrie.    <-this will show up on the menu
  157.                            as a bright green item.
  158.  
  159. The ` is very important.
  160.  
  161. The modules and description files are as follows:
  162.             1fc*.exe
  163.             2fc*.exe
  164.             3fc*.exe           <-IGM names
  165.             4fc*.exe
  166.             5fc*.exe
  167.  
  168.             1fc*.dsc
  169.             2fc*.dsc
  170.             3fc*.dsc           <-Description files
  171.             4fc*.dsc
  172.             5fc*.dsc
  173.  
  174. -And then dump it in the sdloco directory.
  175. They will then run from the corresponding <1> <2> etc from the New Develop-
  176. ments menu on the Favrie Colony.
  177.  
  178. I use the C function _dos_findfirst to look for the module.  I am using the
  179. wildcard characters in the following way:
  180.             1fc*.dsc
  181.             1fc*.exe
  182.             3fc*.dsc, etc.
  183. Anything between the first three letters and the . are yours to add.  I don't
  184. look at them or worry about them.
  185.  
  186. If there are other modules with the same first 3 letters in the directory,
  187. it will run the _first_ one it finds.  Make sure to notify the sysop of this,
  188. and tell them about removing the other favrie module, and possibly renaming it
  189. and adding it to the shipyard module area using the sd_add.exe, or renaming
  190. yours to another module such as 5fcMymod.exe/.dsc.
  191.  
  192. ------------------------------------------------------------------------
  193. For all module areas:
  194. ------------------------------------------------------------------------
  195. Try to make the program install and un-install in a minute or less.  Save
  196. the Sysop all the hassle you can!  They're busy ya know!
  197.  
  198. NOTE WELL:
  199. * You must have exclusive file access if you access my player file!  See the
  200.   C version of the exclusive file access I have included.
  201.  
  202. ABOUT ME:
  203.   I am a new C programmer, as you experienced C people may notice in some
  204.   of the following code.  As a student at DeVry in Phoenix, Az, I decided
  205.   to really learn C the first day of the C class.  So, I wrote this sucker
  206.   in the following month.  I learned some C.  While the rest of the class
  207.   was doing printf, I was banging away at spawning other programs, and
  208.   doodling in memory allocation and serial comm.  They hate me...<JK>
  209.  
  210.   So, you may notice some weird stuff in the code that is in this text file.
  211.   I didn't change some of it because it worked, even though I found out later
  212.   that it wasn't the _best_ way.  But it werked at the time, and werks now.
  213.   Expect nicer cleaner stuff soon.....
  214.  
  215.   And, thanks for reading this, and playing Stardock Loco.  If you know
  216.   how to write stuff, please add on to the game.  It would be tremendously
  217.   cool to have a lot of nice add-ons that are full featured games that
  218.   work together!!  It could make it _the_ game to have!
  219.  
  220.  
  221. All of this is in C, if you don't know C, it shouldn't be too tough for
  222. you Pascalites, or other language types with a big book.
  223.  
  224. -------------------------------------------------------------------------
  225. Expansion Modules:   All areas, Terran Pete's/Shipyard Modules/On ship
  226. -------------------------------------------------------------------------
  227. I make the expansion modules separate entities from the game.  When they run
  228. the module, Stardock Loco is swapped to disk.  Your module then takes control
  229. of any modem interfacing.  When they return, Stardock then checks to see if
  230. the player's lifepoints are greater than 0.  If so, they continue the game.
  231. If not, they are sent back to the BBS.
  232.  
  233. The module is spawned similar to the spawnvpe function in C.  (Opendoors 5.0
  234. od_spawnvpe function).  What I pass to the module is the *path* to the door.sys
  235. or whatever type the door file is for the BBS.  That file contains all the
  236. information that is required for the door.  (od_control structure for Opendoors
  237. users).  Then I extract the player's real name from the door file.
  238.  
  239. Note:  If the game is run in local mode, I pass a switch of /L in the
  240. argv.  This causes the Sysop to log into the module....(gonna change that!)
  241.  
  242. When the player goes to the modules, I look up their real name, then when
  243. the match is found, run the module.  If it isn't found, that is a major error,
  244. and they return...  The favrie.exe Colony has it's own special player file.
  245. fav_pl.lst.  See the example waaaay at the bottom of this file.
  246.  
  247.  
  248. FILE AND CODE INFORMATION:   //Also see MODULE.C (Blackmarket)
  249.  
  250. *****************READ THIS, EVEN IF YOU'RE USING MODULE.C!!***************
  251.  
  252. ---------------------------------------------------------------------------
  253. The main player file as defined in C:       player.lst
  254. ---------------------------------------------------------------------------
  255. The player.lst is saved in text format.
  256.  
  257. I then convert the player to the correct integer and long values that
  258. I need in the game.  (Don't ask why..<G>)
  259.  
  260. //size definitions
  261. #define MAXNAME  30
  262. #define    MAXBBSNAME 36
  263. #define    MAXWEAPONNAME 20
  264. #define    MAXARMORNAME 20
  265. #define MAXSTANDARDLONG 10
  266. #define MAXSTANDARDINT 4
  267.  
  268. struct player
  269.     {
  270.     char on_now[MAXSTANDARDINT+1];  //If they are currently on-line = 1
  271.     char name[MAXNAME+1];           //Game name
  272.     char bbs_name[MAXBBSNAME+1];    //Real name
  273.     char living[MAXSTANDARDINT+1];  //if alive = 1, dead = 0
  274.     char killer[MAXNAME+1];         //Who killed them
  275.     char location[MAXSTANDARDINT+1];  //Where they are.  1=Terran Pete's
  276.                       //                 2=Pods
  277.     char lifepoints[MAXSTANDARDLONG+1];      //lifepoints
  278.     char lifepointsttl[MAXSTANDARDLONG+1];   //Total lifepoints
  279.  
  280.     char weapon[MAXWEAPONNAME+1];            //Weapon name
  281.     char weapon_energy[MAXSTANDARDLONG+1];   //Current amount of Energy Packs
  282.     char weapon_strength[MAXSTANDARDINT+1];  //Weapon strength i.e. 1, 2, 3, 4 etc.
  283.     char max_packs[MAXSTANDARDLONG+1];   //Total energy packs gun will hold
  284.  
  285.     char weapon_status[MAXSTANDARDINT+1];  //if owns weapon = 1
  286.     char weapon_cost[MAXSTANDARDLONG+1];   //Weapon's value
  287.  
  288.     char armor[MAXARMORNAME+1];           //Armor Name
  289.     char armor_strength[MAXSTANDARDLONG+1];   //Strength of Armor
  290.     char armor_status[MAXSTANDARDINT+1];    //if they have armor = 1
  291.     char armor_cost[MAXSTANDARDLONG+1];     //Armor Value
  292.  
  293.     char credits[MAXSTANDARDLONG+1];       //credits on hand
  294.     char bank_credit[MAXSTANDARDLONG+1];   //credits in Guido's Bank
  295.  
  296.     char pod[MAXSTANDARDINT+1];       //if own a pod = 1
  297.  
  298.     //SOMEBODY CRUISE THIS SHIP ALL OVER THE GALAXY PLEASE!!! <G>
  299.     //Battles!  Trading, quests, exploration, planets, stars...
  300.  
  301.     char ship[MAXSTANDARDINT+1];     //if own a ship = 1                     //               2=I'stellar cruiser
  302.     char ship_name[MAXNAME+1];          //name of ship
  303.     char ship_type[MAXSTANDARDINT+1];    //type of ship.  1=garbage scow
  304.                      //                   2=I'stellar cruiser
  305.  
  306.     char mt[MAXSTANDARDINT+1];            //has a matter transmitter =1
  307.     char arkon_bomb[MAXSTANDARDINT+1];    //has a bomb = 1
  308.  
  309.     char level[MAXSTANDARDINT+1];         //player level
  310.     char experience[MAXSTANDARDLONG+1];   //Experience
  311.     char kills[MAXSTANDARDINT+1];         //kills.  <-used on asteroid. Turns used.
  312.     char droids[MAXSTANDARDINT+1];        //number of droids
  313.     char passkey[MAXSTANDARDINT+1];       //number of passkeys
  314.  
  315.      //globals
  316.     char on_off[MAXSTANDARDINT+1];        //if droids armed = 1
  317.     char sickbay_closed[MAXSTANDARDINT+1];   //if sickbay closed = 1
  318.     char bank_closed[MAXSTANDARDINT+1];     //if bank_closed = 1
  319.     char pickpocket[MAXSTANDARDINT+1];     //pickpocketed nurse wetley
  320.     char tipcnt[MAXSTANDARDINT+1];  //how many times stolen tips
  321.     char owns[MAXSTANDARDINT+1];    //owns weaponshop = 1
  322.                     //owns armorshop = 2
  323.                     //owns both = 3
  324.     char fights[MAXSTANDARDINT+1];        //fights used today
  325.     char last_played[MAXSTANDARDINT+1];   //day last played. (stardate)
  326.     };
  327.  
  328.  
  329. That big mess is converted to this in the game:
  330.  
  331.  
  332. struct on_line_player
  333.     {
  334.     int on_now;
  335.     char name[MAXNAME+1];
  336.     char bbs_name[MAXBBSNAME+1];
  337.     int living;
  338.     char killer[MAXNAME+1];
  339.     int location;
  340.     long lifepoints;
  341.     long lifepointsttl;
  342.  
  343.     char weapon[MAXWEAPONNAME+1];
  344.     unsigned long weapon_energy;
  345.     int weapon_strength;
  346.     unsigned long max_packs;
  347.     int weapon_status;
  348.     unsigned long weapon_cost;
  349.  
  350.     char armor[MAXARMORNAME+1];
  351.     unsigned long armor_strength;
  352.     int armor_status;
  353.     unsigned long armor_cost;
  354.  
  355.     unsigned long credits;
  356.     unsigned long bank_credit;
  357.  
  358.     int pod;
  359.  
  360.     int ship;
  361.     char ship_name[MAXNAME+1];
  362.     int ship_type;
  363.     int mt;
  364.     int arkon_bomb;
  365.  
  366.     int level;
  367.     unsigned long experience;
  368.     int kills;
  369.     int droids;
  370.     int passkey;
  371.     int on_off;
  372.     //reset daily by extern:   //from defaults....
  373.     int sickbay_closed;        //killed staff
  374.     int bank_closed;           //angered guido
  375.     int pickpocket;            //picked N. Wetlys pocket
  376.     int tipcnt;                //max tips taken
  377.     int owns;                 //1 owns weapon shop, 2 owns armor shop
  378.     int fights;                //fights used today
  379.     int last_played;           //stardock days running
  380.     };
  381.  
  382. --------------------------------------------------------------------------
  383. Favrie Colony player list:   fav_pl.lst
  384. --------------------------------------------------------------------------
  385. If you wish to use the special skills that the player has gotten on the
  386. colony, or any other stuff, here it is:
  387.  
  388.  
  389. Expect this to change if I expand the colony.
  390.  
  391. struct fahvrie
  392. {
  393. unsigned long cillenium;      //how much cillenium they have found
  394. int skill;                    //skill 1 = nard kick, 2 3 4 5 6 7 8 9
  395.                   //if they are a level 4, they can use 4,3,2,1
  396. int mine_turns;               //turns used in the mine
  397. int fight_turns;              //turns used in the nightclub
  398. int fights;                   //total fights in the nightclub
  399.                   //   important to raise skill level.
  400. unsigned long bank_credit;
  401. };
  402.  
  403.  
  404. As stored in the fav_pl.lst, text format:
  405.  
  406. struct p_file
  407. {
  408. char name[MAXNAME+1];                         //Real Name
  409. char cillenium[MAXSTANDARDLONG+1];            /////////////////////////
  410. char weapon[MAXWEAPONNAME+1];                 /// <<-not used yet
  411. char mine_turns[MAXSTANDARDINT+1];            ///   Same as above
  412. char complex_turns[MAXSTANDARDINT+1];         /// <<-not used yet
  413. char nightclub_turns[MAXSTANDARDINT+1];       ///
  414. char bank_credit[MAXSTANDARDLONG+1];          ///
  415. char fight_turns[MAXSTANDARDINT+1];           ///
  416. char skill[MAXSTANDARDINT+1];                 ///
  417. char fights[MAXSTANDARDINT+1];                ////////////////////////
  418. char exp2[MAXSTANDARDINT+1];       //expansion slot <-not used yet.
  419. char date;             //date last played.  date<<_dos_getdate
  420. };
  421.  
  422.  
  423. --------------------------------------------------------------------------
  424. module.lst  record definition
  425. --------------------------------------------------------------------------
  426. I've added this for those of you that wish to add an easy install for the
  427. sysop that automatically adds your module into the module.lst for the
  428. ShipYards expansion area.
  429.  
  430. Please include an easy un-install as well.
  431.  
  432. #define MAXPATH 36         // length of fields in entry box
  433. #define MAXDESCRIPTION 40
  434.  
  435. struct record
  436. {
  437. char path[MAXPATH];
  438. char description[MAXDESCRIPTION];
  439. };
  440.  
  441. ---------------------------------------------------------------------------
  442. News File:         news.fil
  443. ---------------------------------------------------------------------------
  444. Wanna dump something in the news?  Here ya go.
  445.  
  446. #define MAXNEWS 80
  447.  
  448. struct daily
  449.     {
  450.     char date[MAXSTANDARDINT+1]; //Stardate (game running date for delete)
  451.                      //game starts at 1 - see global.dat file
  452.                      //description for more details on date.
  453.     char line[MAXNEWS+1];    //80 + 1    //news goes here.
  454.     };
  455.  
  456.  
  457.  
  458. ---------------------------------------------------------------------------
  459. Mail File:         mail.fil
  460. ---------------------------------------------------------------------------
  461. #define MAXNEWS 80
  462.  
  463. struct new_mail
  464. {
  465. char from_name[MAXNAME+1];       //from
  466. char to_name[MAXNAME+1];         //to
  467. char line[MAXNEWS+1];            //what they said.
  468. };
  469.  
  470. --------------------------------------------------------------------------
  471. Global.dat file  (Created by the install program sd_init.exe)
  472.          (Stardate updated by first player on new day
  473.           by spawned sd_ext.exe - maintenance program)
  474. --------------------------------------------------------------------------
  475. struct global_file
  476. {
  477. char lifepoints[MAXSTANDARDLONG+1];      //new player lifepoints
  478. char lifepointsttl[MAXSTANDARDLONG+1];   //new player total lifepoints
  479. char credits[MAXSTANDARDLONG+1];         //new player credits
  480. char droids[MAXSTANDARDINT+1];           //new player droids
  481. char tipcnt[MAXSTANDARDINT+1];           //maximum stolen tips a day (turns)
  482. char wep_owner[MAXNAME+1];               //who currently owns weaponshop
  483. char arm_owner[MAXNAME+1];               //who currently owns armorshop
  484. char fights[MAXSTANDARDINT+1];           //fights per day
  485. char stardate[MAXSTANDARDINT+1];         //current stardate running
  486.     //^use this if you create news!     //  this starts at one, and is
  487.                      //  updated during each maintenance
  488.                      //  run.  Incremented by 1.
  489. unsigned char realdate;                  //Real d.day from _dos_getdate
  490. };                                       //I just check for a change.
  491.  
  492.  
  493. --------------------------------------------------------------------------
  494. Exclusive File Access
  495. --------------------------------------------------------------------------
  496. This is the exclusive file access routine used for the program:
  497.  
  498. For those that haven't used exclusive file access:  What this does is
  499. keeps two players from writing or reading a file at the same time.  Big
  500. problems could develop on multi-line BBS's if players are playing
  501. at the same time, and writing the same file at the same moment.  Bad Bad
  502. Bad!!!  <G>
  503.  
  504. Author of the following exclusive file access function:
  505.      Brian Pirie, Opendoors Door Programming Toolkit. <-get it, it's good!
  506.  
  507.  
  508. #define WAIT_FOR_FILE         10       /* Time to wait for access to file */
  509. FILE *OpenExclusiveFile(char *pszFileName, char *pszAccess, time_t Wait);
  510.  
  511.  
  512. FILE *OpenExclusiveFile(char *pszFileName, char *pszAccess, time_t Wait)
  513. {
  514.    FILE *pfFile;
  515.    time_t StartTime = time(NULL);
  516.  
  517.    for(;;)
  518.    {
  519.       /* Attempt to open file */
  520.       pfFile = fopen(pszFileName, pszAccess);
  521.  
  522.       /* If file was opened successfuly, then exit */
  523.       if(pfFile != NULL) break;
  524.  
  525.       /* If open failed, but not due to access failure, then exit */
  526.       if(errno != EACCES) break;
  527.  
  528.       /* If maximum time has elapsed, then exit */
  529.       if(StartTime + Wait < time(NULL)) break;
  530.  
  531.       /* Give the OpenDoors kernel a chance to execute before trying again */
  532.  
  533.           /////////NOTE///////////////////
  534.       od_kernel();  //should be included if you use Opendoors 5.0
  535.    }                //or exclude it if you don't.
  536.  
  537.    /* Return pointer to file, if opened */
  538.    return(pfFile);
  539. }
  540.  
  541. ---------------------------------------------------------------------------
  542. Enemies are hard coded in the game....ewwww.
  543. ---------------------------------------------------------------------------
  544.  
  545. struct enemy
  546.     {
  547.     char name[MAXNAME+1];    //name of alien
  548.     int living;       //if alive = 1
  549.     char weapon[MAXWEAPONNAME+1];    //weapon name
  550.     unsigned long weapon_energy;     //weapon enemy
  551.     int weapon_strength;            //weapon strength
  552.     int level;                      //level <-not used
  553.     unsigned long experience;       //experience
  554.     int kills;                      //kills <-not used
  555.     int weapon_status;     //if they have a weapon = 1  <-not used
  556.     char armor[MAXARMORNAME+1];       //armor name
  557.     unsigned long armor_strength;     //armor strength
  558.     unsigned long credits;           //credits
  559.     long lifepoints;                 //yep
  560.     long lifepointsttl;              //uh-huh
  561.     };
  562.  
  563.  
  564. Well, there it all is.  If you want some more info, write me e-mail at
  565. alanen@hvs.mail.com (Rock Garden BBS, Phoenix AZ) or at the Sherwood Forest
  566. BBS, (602) 876-0013.
  567. I'd be glad to look at what you have, or try to answer any pertinent questions.
  568.  
  569.  
  570. Hasta luego amigos.  Estamos locos....(pardon my bad spanish)  I'm a finlander
  571. that should be herding raindeer, not babbling in spanish and drinking irish
  572. cervezas...<G>
  573.  
  574. ----------------------------------------------------------------------------
  575. More Help for Opendoors Hombres...
  576. ----------------------------------------------------------------------------
  577. This is the main routine for the favrie colony. Also follows is a
  578. player file read for any module or main file.  See also MODULE.C.
  579.  
  580. void main(int argc,char *_argv[])
  581. {
  582. int counter;
  583. int sync=0;
  584.  
  585. for(counter=1;counter<argc;++counter)
  586.  
  587.     {
  588.     if((_argv[counter])[1]=='l'||(_argv[counter])[1]=='L')
  589.         {
  590.         od_control.od_force_local=TRUE;   //make it local mode.
  591.         od_clr_scr();
  592.         od_printf("`cyan`╒═════════════════════════════════════════════════════════════╕\n\r");
  593.         od_printf("│`green`STARDOCK LOCO -`cyan` Local Mode  - Favrie Colony                  │\n\r");
  594.         od_printf("╘═════════════════════════════════════════════════════════════╛\n\r");
  595.         od_printf(" Enter your name: ");
  596.         od_input_str(door_sys_name,MAXBBSNAME,32,127);
  597.         door();
  598.         sync=1; //keep from playing game twice.
  599.         }
  600.       }
  601. if(sync==0)         //otherwise we play game twice in local mode...
  602. {                   //hey, I'm new at this...<G>
  603. if(argc>1) strncpy(od_control.info_path,_argv[1],59);  //path to door file
  604. od_init();                                     //opendoors initialization.
  605. strcpy(door_sys_name,od_control.user_name);   //move user_name from door.sys
  606. door();                                       //to my door_sys_name.
  607. }
  608. }
  609.  
  610. #define    MAXBBSNAME 36
  611. char door_sys_name[MAXBBSNAME+1];
  612.  
  613.  
  614. void door(void)
  615. {
  616. char answer;
  617. r_player_file();           //get the player's normal stats.
  618. if(playerfound==1)
  619. {
  620. r_fahvrie_file();          //get the player's favrie stats.
  621. od_clr_scr();              //clear screen.
  622. od_printf("\n\r╒═════════════════════════════════════════════════════════════╕\n\r");
  623. od_printf("│`green`STARDOCK LOCO -`cyan` Rental Craft                                 │\n\r");
  624. od_printf("╘═════════════════════════════════════════════════════════════╛\n\r");
  625. od_printf("You get into the little short range Needler that you rented\n\r");
  626. od_printf("from Guido and head over to the Favrie Colony. \n\r");
  627. od_printf("\n\r             <`red`L`cyan`> Land at the Favrie Colony\n\r");
  628. od_printf("             <`red`X`cyan`> Exit back to Stardock\n\r");
  629. od_printf("\n\rMake your choice:  ");
  630. answer=od_get_answer("LX\n\r");
  631. switch(answer)
  632.     {
  633.     case 'X':
  634.         od_printf("\n\rScared of Deep Space, you decide to return to the Stardock.");
  635.         WaitForEnter();
  636.         break;
  637.     case 'L':
  638.     default:
  639.         favrie_main();    //main favrie screen and options menu.
  640.         break;
  641.     }
  642. }
  643. else
  644.     {
  645.     od_printf("\n\rPlayer not found!");
  646.     od_printf("Name Error.");
  647.     WaitForEnter();
  648.     }           //then will return from whence it came...
  649. }
  650.  
  651.  
  652. ////////////////////read of player file to get details///////////////
  653.  
  654. void r_player_file(void)
  655. {
  656. struct player *names;
  657. int p;
  658. FILE *fptr;
  659. record_count=0;
  660. if((names=(struct player*) calloc(100,sizeof(struct player)))==NULL)
  661.     {
  662.     od_printf("\n\rNot enough memory for Player.lst");
  663.     WaitForEnter();
  664.     }
  665. else
  666. {              ///must have the exclusive file access....
  667.     fptr = OpenExclusiveFile("player.lst", "rb", WAIT_FOR_FILE);
  668.     while( fread(&names[record_count],sizeof(names[record_count]),1,fptr)==1)
  669.         record_count++;
  670.     fclose(fptr);
  671.        }
  672.  
  673.                //check for a match of name[p].bbs_name
  674.               //against door_sys_name
  675. for(p=0;p<record_count;p++)
  676.     { //begin for
  677.     if (stricmp (door_sys_name,names[p].bbs_name) ==0 )
  678.         {  //begin if
  679.         playerfound=1;     //player is found...
  680.         strcpy(current.name,names[p].name);
  681.         strcpy(current.bbs_name,names[p].bbs_name);
  682.         current.living=atoi(names[p].living);
  683.         strcpy(current.killer,names[p].killer);
  684.         current.location=atoi(names[p].location);
  685.         current.lifepoints=atol(names[p].lifepoints);
  686.         current.lifepointsttl=atol(names[p].lifepointsttl);
  687.         /////////AAAAAAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGGGHHHHHH
  688.         strcpy(current.weapon,names[p].weapon);
  689.         current.weapon_energy=atol(names[p].weapon_energy);
  690.         current.weapon_strength=atoi(names[p].weapon_strength);
  691.         current.max_packs=atol(names[p].max_packs);
  692.         /////////////lalalalalallaalalalalalalalal
  693.         current.weapon_status=atoi(names[p].weapon_status);
  694.         current.weapon_cost=atol(names[p].weapon_cost);
  695.  
  696.         strcpy(current.armor,names[p].armor);
  697.         current.armor_strength=atol(names[p].armor_strength);
  698.         current.armor_status=atoi(names[p].armor_status);
  699.         current.armor_cost=atol(names[p].armor_cost);
  700.  
  701.         current.credits=atol(names[p].credits);
  702.         current.bank_credit=atol(names[p].bank_credit);
  703.  
  704.         current.pod=atoi(names[p].pod);
  705.       ///AND THERE IS YET MORE!!!!!!!!!!!!!
  706.         current.ship=atoi(names[p].ship);
  707.         strcpy(current.ship_name,names[p].ship_name);
  708.         current.ship_type=atoi(names[p].ship_type);
  709.         current.mt=atoi(names[p].mt);
  710.         current.arkon_bomb=atoi(names[p].arkon_bomb);
  711.      ///Talk about a pain in the butt.
  712.         current.level=atoi(names[p].level);
  713.         current.kills=atoi(names[p].kills);
  714.         current.experience=atol(names[p].experience);
  715.         current.droids=atoi(names[p].droids);
  716.         current.passkey=atoi(names[p].passkey);
  717.      ///I shan't do it like this again......
  718.         current.on_off=atoi(names[p].on_off);
  719.         current.sickbay_closed=atoi(names[p].sickbay_closed);
  720.         current.bank_closed=atoi(names[p].bank_closed);
  721.         current.pickpocket=atoi(names[p].pickpocket);
  722.         current.tipcnt=atoi(names[p].tipcnt);
  723.         current.owns=atoi(names[p].owns);
  724.         current.fights=atoi(names[p].fights);
  725.         current.last_played=atoi(names[p].last_played);
  726.      //////////get me outta here!!!!!!!!!!
  727.         p=record_count;
  728.         }    //end if
  729.      else playerfound=0;
  730.     }  //end for
  731. free(names);       /////Dump the calloc
  732. }
  733.  
  734. Any additional questions can be sent to me at the following addresses:
  735. ----------------------------------------------------------------------------
  736. The support BBS for new versions of Stardock Loco is the Sherwood Forest BBS.
  737. This BBS is run by a friend of mine, John Myers, aka Little_john.
  738.  
  739. The number is: (602) 876-0013.
  740.  
  741. To access the file and message areas for Stardock Loco,
  742. use the following log-in:
  743.  
  744. First Name:     Stardock
  745. Last Name :     Loco
  746. Password  :     Support
  747.  
  748. My name, if you forgot, is Aaron Alanen.  I can also be reached by i-mail/e-mail
  749. at alanen@mail.hvs.com (Rock Garden BBS, Phoenix, AZ)
  750.  
  751. Other ways to reach me:
  752.  
  753. aaron.alanen@jccs.parasol.stat.com
  754. MajorNet: notme atall@rok
  755.  
  756. I can also be reached in Phoenix, Arizona at the following BBS:
  757.  
  758.         JCCS BBS            : (602) 582-4200
  759.  
  760. (Note: I am only a member there, and not the SySop!)
  761.  
  762. Or snail:
  763.  
  764.         Aaron Alanen
  765.         6502 E. Vernon
  766.         Scottsdale, AZ 85257-1140
  767.         USA.
  768.  
  769. See the ORDER.FRM to get information on registering Stardock Loco!
  770.  
  771. Thanks for reading this far!
  772. ----------------------------------------------------------------------------